/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #000;
    color: #333;
}

/* 页面容器 */
.add-course-page {
    min-height: 100vh;
    padding: 20px;
}

.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

/* 返回导航 */
.back-nav {
    margin-bottom: 20px;
}

.back-link {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 20px;
    color: #333;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #666;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* 两列布局 */
.form-row {
    display: flex;
    gap: 20px;
}

.form-group.half {
    flex: 1;
}

/* 课程封面上传区域样式 */
.upload-area {
    border: 1px dashed #ddd;
    border-radius: 4px;
    height: 200px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.upload-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
}

.upload-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.upload-desc {
    font-size: 12px;
    color: #999;
}

.preview-content {
    width: 100%;
    height: 100%;
}

.preview-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* 编辑器工具栏 */
.editor-toolbar {
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: 8px;
    background: #f5f5f5;
}

.editor-toolbar button {
    padding: 4px 8px;
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 4px;
    font-size: 14px;
}

.editor-toolbar button:hover {
    background: #e8e8e8;
    border-radius: 2px;
}

/* 课程大纲样式 */
.add-chapter-btn {
    padding: 8px 16px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 20px;
}

.chapter-item {
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 12px;
}

.chapter-header {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.chapter-title {
    display: flex;
    align-items: center;
    flex: 1;
}

.chapter-number {
    font-size: 14px;
    color: #666;
    margin-right: 8px;
}

.chapter-name {
    border: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    width: 200px;
    padding: 4px 8px;
}

.chapter-name:focus {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

.chapter-actions {
    display: flex;
    gap: 8px;
}

.add-video-btn {
    padding: 4px 12px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.edit-btn,
.delete-btn,
.video-delete-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
}

.chapter-content {
    padding: 12px;
}

/* 视频列表样式 */
.video-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.video-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 4px;
}

.video-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-name {
    font-size: 14px;
    color: #333;
}

.video-duration {
    font-size: 12px;
    color: #999;
}

.video-actions {
    display: flex;
    gap: 8px;
}

/* 视频上传样式 */
.video-upload {
    border: 1px dashed #ddd;
    border-radius: 4px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
}

.upload-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #666;
}

.upload-icon {
    font-size: 24px;
}

.upload-progress {
    margin-top: 8px;
}

.progress-bar {
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #000;
    width: 0;
    transition: width 0.3s;
}

.progress-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* 讲师信息样式 */
.teacher-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 4px;
}

.teacher-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.teacher-desc {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* 底部按钮 */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 40px;
}

.btn-draft,
.btn-publish {
    padding: 8px 24px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.btn-draft {
    background: none;
    border: 1px solid #ddd;
    color: #666;
}

.btn-draft:hover {
    background: #f5f5f5;
}

.btn-publish {
    background: #000;
    border: none;
    color: #fff;
}

.btn-publish:hover {
    background: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 0 16px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group.half {
        width: 100%;
    }

    .teacher-profile {
        flex-direction: column;
        text-align: center;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-draft,
    .btn-publish {
        width: 100%;
    }
}

.chapter-header {
    cursor: move;
    /* 指示可拖拽 */
}

.ui-sortable-helper {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ui-sortable-placeholder {
    visibility: visible !important;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 4px;
    margin-bottom: 12px;
}

.chapter-edit-input,
.video-edit-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin: 2px 0;
}

.chapter-edit-input:focus,
.video-edit-input:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.chapter-name,
.video-name {
    cursor: pointer;
}

.chapter-name:hover,
.video-name:hover {
    color: #1890ff;
}

.edit-btn {
    cursor: pointer;
    background: none;
    border: none;
    color: #666;
    padding: 2px 5px;
    font-size: 16px;
}

.edit-btn:hover {
    color: #1890ff;
}

.video-edit-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    padding: 4px 8px;
}

.video-extension {
    margin-left: 2px;
    color: #666;
}